<?php
class name{
	private $map=array(
		'site'=>array('table'=>'site','select'=>'id,domain AS name'),
		'billboard'=>array('table'=>'billboard','select'=>'id,name'),
		'advertisers'=>array('table'=>'advertisers','select'=>'id,name'),
		'usage'=>array('table'=>'sort','select'=>'id,name'),
		'modality'=>array('table'=>'sort','select'=>'id,name'),
		'format'=>array('table'=>'sort','select'=>'id,name'),
		'province'=>array('table'=>'sort','select'=>'id,name'),
		'city'=>array('table'=>'sort','select'=>'id,name'),
		'browser'=>array('table'=>'sort','select'=>'id,name'),
		'lang'=>array('table'=>'sort','select'=>'id,name'),
		'system'=>array('table'=>'sort','select'=>'id,name'),
		'screen'=>array('table'=>'sort','select'=>'id,name')
	);
    public function init($params=array()){
		$this->db=$this->yum->library('mysql');
		$this->prefix=$this->yum->vars('app','prefix');
	}
	public function select($index,$pams=array()){
		$names=array();
		if(is_string($index)){
			$index=array($index=>$pams);
		}
		foreach($index as $key=>$value){
			$names[$key]=$this->db->select($this->prefix.$this->map[$key]['table'],array('select'=>$this->map[$key]['select'],'where'=>array('id IN'=>$value)));
		}
		return $names;
	}
}
?>